package com.gylang.sso.service.impl;

import com.gylang.common.jwt.JwtRole;
import com.gylang.common.jwt.JwtUser;
import com.gylang.sso.domain.SysUser;
import com.gylang.sso.service.LoginService;
import com.gylang.sso.service.SysMenuService;
import com.gylang.sso.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author gylang,
 * @data 2019/12/7 20:05,
 * @DESC
 */
public class LoginServiceImpl implements LoginService {

    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private SysMenuService sysMenuService;

    @Override
    public JwtUser Login(String username, String password) {

//        SysUser user = sysUserService.findByUserName(username);
//        if (null)
//        Set<String> permissions = findPermissions(s);
//        System.out.println(permissions);
//        List<JwtRole> grantedAuthorities = permissions.stream().map(JwtRole::new).collect(Collectors.toList());
        return null;
    }
}
